<div class="table-responsive card-lg">
  <table class="table table-condensed" id='refunds' data-order-id='<%= @order.number %>'>
    <thead>
      <tr data-hook="refunds_header" class="border-bottom">
        <th scope="col"><%= "#{Spree.t('date')}/#{Spree.t('time')}" %></th>
        <th scope="col"><%= Spree.t(:amount) %></th>
        <th scope="col"><%= Spree.t(:reason) %></th>
        <% if show_actions %>
          <th scope="col"></th>
        <% end %>
      </tr>
    </thead>
    <tbody>
      <% refunds.each do |refund| %>
        <tr id="<%= spree_dom_id(refund) %>">
          <td><%= spree_time(refund.created_at) %></td>
          <td class="amount"><%= refund.display_amount %></td>
          <td><%= truncate(refund.reason.name, length: 100) %></td>
          <% if show_actions && !refund.payment.order.canceled? %>
            <td class="actions">
              <%= link_to_with_icon('edit', Spree.t(:edit), spree.edit_admin_order_payment_refund_path(refund.payment.order, refund.payment, refund), no_text: true, data: { turbo_frame: 'dialog', action: 'dialog#open' }, class: "btn btn-light btn-sm") if can?(:edit, refund) %>
            </td>
          <% end %>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>
